﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TestOnlineProject.Models.Entities;

namespace TestOnlineProject.Models.DataAccess
{
    public class QuestionTypeDAO
    {
        TestOnlineDBEntities db = new TestOnlineDBEntities();

        public List<QuestionType> Select()
        {
            var questionTypes = db.QuestionTypes.ToList();
            return questionTypes;
        }

        public QuestionType SelectByQuestionTypeId(int questionTypeId)
        {
            var questionType = db.QuestionTypes.Where(t => t.QuestionTypeId == questionTypeId).FirstOrDefault();
            return questionType;
        }
    }
}